<style>
#mnuRef{ position:absolute;z-index:100; left:0px; background-color:#ffffff; border:1px solid #BFBFBF;width:209px; top:40px; display:none;}
#mnuRef ul{list-style:none; padding:0; margin:0;}
#mnuRef ul li{width:100%; height:30px; line-height:30px; text-align:left; padding-left:2px;}
#mnuRef ul li:hover{ background-color:#EEE} 
#divref{position:absolute; border:1px #E5E5E5 solid; background-color:#ffffff;width:300px;height:68px;left:-47px;display:none; top:30px; vertical-align:middle;z-index:999}
#divref img{width:75px;height:47px; vertical-align:middle;}
#divref #info{height:21px;width:75px; background-image:url(../images/reftitlebg.png); background-repeat:repeat; position:absolute; bottom:0px; line-height:20px; text-align:center; color:#ffffff; font-size:10px; }
</style>
<script>
var isShowReferer = false;
function navOpenPage(i)
{
    if(i==0)
	{
    	$("#trDetail").hide();
		$("#trListData").show();
		 
		if(k=="myFav" || isShowReferer)
		{
			window.location.href="main.php";
		}
		if($("#groupTitle").html()!="")
		{
			window.location.href="main.php";
			$("#groupTitle").html("");
		}
	}
	else if(i==1)
	{
	//	getPage("../index.php?act=ajax&op=getLstFile&k=newPic");
 
	if(isShowReferer)
	{
		$("#divref").hide();
		isShowReferer = false;
	}
	else
	{
		isShowReferer = true;
		$("#divref").show();
	    $.get("../index.php?act=ajax&op=getRefer",function(d){

			var j = eval("("+d+")");
 
			$("#imgref1")[0].src = "../"+j[0].pic;
			$("#imgref2")[0].src = "../"+j[1].pic;
			$("#imgref3")[0].src = "../"+j[2].pic;
			$("#imgref4")[0].src = "../"+j[3].pic;
			$("#imgref1").parent().find("#info").html(j[0].subject);
			$("#imgref2").parent().find("#info").html(j[1].subject);
			$("#imgref3").parent().find("#info").html(j[2].subject);
			$("#imgref4").parent().find("#info").html(j[3].subject);
			
			});
	}
	}
	else if(i==2)
	{
		$("#divref").hide();
		k="myFav";
		getPage("index.php?act=ajax&op=getLstFile&k=myFav");
	}
	else if(i==3)
	{
		
	}
	else if(i==4)
	{
		window.location.href="../index.php?act=logout&src=m";
	}
}
function keywordsPress(obj)
{
	$.get("../index.php?act=ajax&op=queryKey&k="+obj.value,function(d){
		 
	    var j = eval("("+d+")");
		if(j.length>0)
		{
			var li = "";
			for(i=0;i<j.length;i++)
			{
				 li = li + "<li>"+j[i]+"</li>";
			}
			$("#ulMnuRef").html(li);
			$("#mnuRef").show();
			$("#ulMnuRef").find("li").each(function(){
				var jq = $(this);
				jq.click(function(){
					obj.value=jq.html();
					$("#mnuRef").hide();
					doSearch();
					});
				});
		}
		else
		{
			$("#mnuRef").hide();
		}
	});
}
function headerOpenPage(url)
{
    var curUrl = window.location.href;
    if(curUrl.indexOf("op=detail")==-1)
    {
    	getPage(url);
    }
    else
    {
        window.location.href="?act=main"+url.replace("?act=ajax&op=getLstFile","");
    }
}
function doSearch()
{
	var key = $("#txtQuery").val();
	if(key!="")
	{
		headerOpenPage("index.php?act=ajax&op=getLstFile&k="+encodeURIComponent(key));
	}
}
$(function(){
	$("#divref").find("img").each(function(){
				   var jq = $(this);
				   jq.click(function(){
					 k = jq.parent().find("#info").html();
					// alert(k);
				   	 getPage("index.php?act=ajax&op=getLstFile&k="+encodeURIComponent(k));
					 $("#divref").hide();
					   });

				   //$("#divref").hide();
				});
	})
</script>
<table class="nav" cellpadding="0" cellspacing="0">
<tr><td height="12"></td></tr>
<tr><td height="30" colspan="5" align="left" style="padding-left:18px; color:#8a8d8b; font-size:16px;"><img src="images/logo.png" height="37"/>&nbsp;&nbsp;内容厨房</td></tr>
<tr><td height="35" colspan="5" style="position:relative;"><div class="field"><input type="text" style="width:180px;" id="txtQuery" onKeyUp="keywordsPress(this);"/><img src="images/ser.png" onClick="doSearch();"/></div>
<div id="mnuRef">
    <ul id="ulMnuRef">
    </ul>
    
    </div>
</td></tr>
<tr><td><img src="images/i.png" height="10" onClick="navOpenPage(0);"/></td>
<td style="position:relative;"><img src="images/r.png" height="10" onClick="navOpenPage(1);"/>
<div id="divref"><table cellpadding="0" cellspacing="0" width="100%"><td><img id="imgref1"/><div id="info"></div></td></td><td><img id="imgref2"/><div id="info"></div></td><td><img id="imgref3"/><div id="info"></div></td><td><img id="imgref4"/><div id="info"></div></td></table></div>
</td>
<td><img src="images/f.png" height="10" onClick="navOpenPage(2);"/></td>
<td><img src="images/help.png" height="10" onClick="navOpenPage(3);"/></td>
<td><img src="images/e.png" height="10" onClick="navOpenPage(4);"/></td></tr>
<tr><td></td></tr>
</table>